package com.mimiwang.school.service.impl;

import com.mimiwang.school.domain.SchoolArea;
import com.mimiwang.school.mapper.SchoolAreaMapper;
import com.mimiwang.school.service.ISchoolAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学校Service业务层处理
 * 
 * @author ylb
 * @date 2023-04-16
 */
@Service
public class SchoolAreaServiceImpl implements ISchoolAreaService 
{
    @Autowired
    private SchoolAreaMapper schoolAreaMapper;

    /**
     * 查询学校
     * 
     * @param id 学校主键
     * @return 学校
     */
    @Override
    public SchoolArea selectAreaById(Long id)
    {
        return schoolAreaMapper.selectSchoolAreaById(id);
    }

    /**
     * 查询学校列表
     * 
     * @param campusId 校区id
     * @return 学校
     */
    @Override
    public List<SchoolArea> selectAreaListByCampusId(long campusId)
    {

        return schoolAreaMapper.selectSchoolAreaListByCampusId(campusId);
    }

    /**
     * 新增学校
     * 
     * @param schoolArea 学校
     * @return 结果
     */
    @Override
    public int insertSchoolArea(SchoolArea schoolArea)
    {
        return schoolAreaMapper.insertSchoolArea(schoolArea);
    }

    /**
     * 修改学校
     * 
     * @param schoolArea 学校
     * @return 结果
     */
    @Override
    public int updateSchoolArea(SchoolArea schoolArea)
    {
        return schoolAreaMapper.updateSchoolArea(schoolArea);
    }

    /**
     * 批量删除学校
     * 
     * @param ids 需要删除的学校主键
     * @return 结果
     */
    @Override
    public int deleteSchoolAreaByIds(Long[] ids)
    {
        return schoolAreaMapper.deleteSchoolAreaByIds(ids);
    }

    /**
     * 删除学校信息
     * 
     * @param id 学校主键
     * @return 结果
     */
    @Override
    public int deleteSchoolAreaById(Long id)
    {
        return schoolAreaMapper.deleteSchoolAreaById(id);
    }
}
